﻿@using FineUIMvc.EmptyProject.Controllers;
@{
    Layout = null;
    //ViewBag.Title = "";
}

@{ 
    DateTime? _StartTime = ViewBag.StartTime;
    DateTime? _EndTime = ViewBag.EndTime;

    DateTime StartTime = new DateTime();
    DateTime EndTime = new DateTime();

    if (_StartTime != null)
    {
        StartTime = (DateTime)_StartTime;
    }
    else
    {
        StartTime = DateTime.Now;
    }

    if (_EndTime != null)
    {
        EndTime = (DateTime)_EndTime;
    }
    else
    {
        EndTime = DateTime.Now;
    }

    TerminalStatistic ts = ViewBag.TerminalStatistic;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>@ViewBag.Title</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm-extend.min.css">

</head>
<body>
    <div class="page-group">
        <div class="page page-current">
            <!-- 你的html代码 -->
            <header class="bar bar-nav">
                <h1 class="title">@ViewBag.Title 的统计</h1>
            </header>

            <div class="content">
                <div class="content-block">
                    <form id="QueryForm" action="~/Mobile/TerminalAnalysis/@ViewBag.ID" method="post">
                        <div class="list-block">
                            <ul>
                                <!-- Text inputs -->
                                <li>
                                    <div class="item-content">
                                        <div class="item-inner">
                                            <div class="item-title label">开始日期</div>
                                            <div class="item-input">
                                                <input id="startTime" name="startTime" value="@StartTime.ToString("yyyy-MM-dd")" type="text" data-toggle='date' />
                                            </div>
                                        </div>
                                    </div>
                                </li>
                                <li>
                                    <div class="item-content">
                                        <div class="item-inner">
                                            <div class="item-title label">结束日期</div>
                                            <div class="item-input">
                                                <input id="endTime" name="endTime" value="@EndTime.ToString("yyyy-MM-dd")" type="text" data-toggle='date' />
                                            </div>
                                        </div>
                                    </div>
                                </li>

                                <li>
                                    <div class="item-content">
                                        <div class="item-inner">
                                            <div class="item-input">
                                                <div class="content-block">
                                                    <p><a href="javascript:$('#QueryForm').submit();" class="button button-success">查询</a></p>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </form>
                </div>

                <div class="content-block-title">押箱套详情</div>
                <div class="list-block">
                    <ul>
                        @foreach (KeyValuePair<string, int> d in ViewBag.WapperCountDic)
                        {
                            <li class="item-content">
                                <div class="item-media"><i class="icon icon-f7"></i></div>
                                <div class="item-inner">
                                    <div class="item-title">@d.Key</div>
                                    <div class="item-after">@d.Value &nbsp;&nbsp;个</div>
                                </div>
                            </li>
                        }


                    </ul>
                </div>

                <div class="content-block-title">总订单数量</div>
                <div class="list-block">
                    <ul>
                        <li class="item-content">
                            <div class="item-media"><i class="icon icon-f7"></i></div>
                            <div class="item-inner">
                                <div class="item-title">订单总数</div>
                                <div class="item-after">@ts.OrderCount &nbsp;&nbsp;个</div>
                            </div>
                        </li>
                        <li class="item-content">
                            <div class="item-media"><i class="icon icon-f7"></i></div>
                            <div class="item-inner">
                                <div class="item-title">种类总数</div>
                                <div class="item-after">@ts.CategoryCount &nbsp;&nbsp;种</div>
                            </div>
                        </li>
                        <li class="item-content">
                            <div class="item-media"><i class="icon icon-f7"></i></div>
                            <div class="item-inner">
                                <div class="item-title">商品总数</div>
                                <div class="item-after">@ts.Count &nbsp;&nbsp;箱</div>
                            </div>
                        </li>
                        <li class="item-content">
                            <div class="item-media"><i class="icon icon-f7"></i></div>
                            <div class="item-inner">
                                <div class="item-title">总价</div>
                                <div class="item-after">@ts.CountPrice &nbsp;&nbsp;元</div>
                            </div>
                        </li>
                    </ul>
                </div>



                @foreach (var uog in ts.UserOrderGoodsList)
                {
                    <div class="content-block-title">@uog.GoodsName</div>
                    <div class="list-block">
                        <ul>
                            <li class="item-content">
                                <div class="item-media"><i class="icon icon-f7"></i></div>
                                <div class="item-inner">
                                    <div class="item-title">商品数量</div>
                                    <div class="item-after">@uog.Count &nbsp;&nbsp;箱</div>
                                </div>
                            </li>
                            <li class="item-content">
                                <div class="item-media"><i class="icon icon-f7"></i></div>
                                <div class="item-inner">
                                    <div class="item-title">总价</div>
                                    <div class="item-after">@uog.CountPrice &nbsp;&nbsp;元</div>
                                </div>
                            </li>
                        </ul>
                    </div>
                }

            </div>
        </div>
    </div>

    <script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>

    <script>
        $.init();
    </script>

</body>
</html>

